<template>
	<div class="newsContent">
		<h4 class="title">新闻详情</h4>
		<p>
			<span>发表时间：</span><span>点击次数</span>
		</p>
		<hr>
		<div class="content"></div>
		<commit-box :artid="id"></commit-box>
	</div>
</template>
<style lang="scss">
	.newsContent{
		padding: 0px 4px;

		.title{
			font-size: 16px;
			color:red;
			text-align: center;
			margin:10px 0px;
		}
		p{
			display: flex;
			justify-content:space-between;
			color:#33c9FF;
		}
		hr{
			color:gray;
		}
	}
</style>
<script>
	import commit from '../subComponents/commit.vue'
	import { Toast } from 'mint-ui';
	export default{
		data:function(){
			return{
				id:this.$route.params.id,
				newsBody:''
			};
		},
		methods:{
			getNewsContent:function(){
			this.$http.get('api/getnew/'+this.id).then(result=>{
			
				if(result.body.status==0)
				{
					this.newsBody = result.body.message;

				}
			else{
				Toast('新闻详情加载失败');
			}
			});
		}
	
	},
	created:function(){
			this.getNewsContent();
		},
	components:{
		'commit-box':commit

	}
}
</script>